<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="js/code.jquery.com_jquery-3.7.1.js"></script>
</head>
<style>
  canvas {
    border: 1px solid black;
  }
</style>

<body>
  <img src="" alt="" srcset="">
  <div>
    <div class="n"></div>
  </div>
</body>
<script>
  $().ready(function () {
    

   
    console.log($(".n").prev(),1)
    ;
  })
</script>

</html>